package com.esri.core.map;

import com.esri.core.internal.util.d;
import com.tencent.smtt.sdk.TbsVideoCacheTask;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;

/* loaded from: classes.dex */
public class WebMapQuery {
    public static final String PARAM_DEFAULTVALUE = "defaultValue";
    public static final String PARAM_FIELD = "field";
    public static final String PARAM_HELPTIP = "helpTip";
    public static final String PARAM_OPERATOR = "operator";
    public static final String PARAM_PROMPT = "prompt";
    String a;
    String b;
    List<Hashtable<String, Object>> c;
    String d;
    List<String> e;
    String f;

    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("WebMapQuery [displayField=");
        sb.append(this.a);
        sb.append(", name=");
        sb.append(this.b);
        sb.append(", parameters=");
        List<Hashtable<String, Object>> list = this.c;
        sb.append(list != null ? list.subList(0, Math.min(list.size(), 10)) : null);
        sb.append(", url=");
        sb.append(this.d);
        sb.append(", visibleFields=");
        List<String> list2 = this.e;
        sb.append(list2 != null ? list2.subList(0, Math.min(list2.size(), 10)) : null);
        sb.append(", whereClause=");
        sb.append(this.f);
        sb.append("]");
        return sb.toString();
    }

    public String getDisplayField() {
        return this.a;
    }

    public String getName() {
        return this.b;
    }

    public List<Hashtable<String, Object>> getParameters() {
        return this.c;
    }

    public String getUrl() {
        return this.d;
    }

    public List<String> getVisibleFields() {
        return this.e;
    }

    public String getWhereClause() {
        return this.f;
    }

    public static WebMapQuery fromJson(JsonParser jsonParser) throws Exception {
        if (jsonParser.getCurrentToken() != JsonToken.START_OBJECT) {
            return null;
        }
        WebMapQuery webMapQuery = new WebMapQuery();
        while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
            String currentName = jsonParser.getCurrentName();
            jsonParser.nextToken();
            if ("displayField".equals(currentName)) {
                webMapQuery.a = jsonParser.getText();
            } else if ("name".equals(currentName)) {
                webMapQuery.b = jsonParser.getText();
            } else if ("parameters".equals(currentName)) {
                webMapQuery.c = new ArrayList();
                while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
                    Hashtable<String, Object> hashtable = new Hashtable<>();
                    d.a(jsonParser, hashtable);
                    webMapQuery.c.add(hashtable);
                }
            } else if (TbsVideoCacheTask.KEY_VIDEO_CACHE_PARAM_URL.equals(currentName)) {
                webMapQuery.d = jsonParser.getText();
            } else if ("visibleFields".equals(currentName)) {
                webMapQuery.e = new ArrayList();
                while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
                    webMapQuery.e.add(jsonParser.getText());
                }
            } else if ("whereClause".equals(currentName)) {
                webMapQuery.f = jsonParser.getText();
            } else {
                jsonParser.skipChildren();
            }
        }
        return webMapQuery;
    }
}
